# Maintainer: Ray Donnelly <mingw.android@gmail.com>

pkgname=remake
conflicts=("remake-git")
replaces=("remake-git")
_remakever="dbg-1.5"
pkgver=4.3+dbg1.5
pkgrel=2
pkgdesc="Enhanced GNU Make - tracing, error reporting, debugging, profiling and more"
arch=('i686' 'x86_64')
url="https://github.com/rocky/remake"
license=('GPL3')
depends=('guile'
         'libreadline')
#options=('debug' '!strip')
makedepends=('gettext'
             'gettext-devel'
             'git'
             'wget'
             'libreadline-devel')
source=("https://sourceforge.net/projects/bashdb/files/remake/4.3%2B${_remakever}/remake-4.3%2B${_remakever}.tar.gz")
sha256sums=('2e6eb709f3e6b85893f14f15e34b4c9b754aceaef0b92bb6ca3a025f10119d76')

prepare() {
  cd ${srcdir}/${pkgname}-4.3+${_remakever}
  autoreconf -fiv
}

build() {
  cd ${srcdir}/${pkgname}-4.3+${_remakever}
  CFLAGS+=" -fcommon"
  ./configure \
    --prefix=/usr \
    --build=${CHOST} \
    --without-libintl-prefix \
    --without-libiconv-prefix \
    ac_cv_dos_paths=yes

  make
}

check() {
  cd ${srcdir}/${pkgname}-4.3+${_remakever}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-4.3+${_remakever}
  make DESTDIR=${pkgdir} install
  rm "${pkgdir}"/usr/share/info/make.info{,-1,-2}
}
